#ifndef _FL_LOGIN_SCENE_H__
#define _FL_LOGIN_SCENE_H__

#include "cocos2d.h"
#include "ui/UIWidget.h"
#include "ui/UITextField.h"

class LoginScene : public cocos2d::Layer
{
public:
	// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
	virtual bool init();  

	// there's no 'id' in cpp, so we recommend returning the class instance pointer
	static cocos2d::Scene* scene();

	void eventCloseButton(cocos2d::Ref* sender, cocos2d::ui::TouchEventType type);
	void eventLoginButton(cocos2d::Ref* sender, cocos2d::ui::TouchEventType type);
	void eventAccountText(cocos2d::Ref* sender, cocos2d::ui::TextFiledEventType type);
	void eventPasswordText(cocos2d::Ref* sender, cocos2d::ui::TextFiledEventType type);

	void eventKeyboardPressed(cocos2d::EventKeyboard::KeyCode, cocos2d::Event*);
	// a selector callback
	//void menuCloseCallback(Ref* sender);

	// implement the "static node()" method manually
	CREATE_FUNC(LoginScene);

private:
	void doLogin();

private:
	cocos2d::ui::TextField* m_pAccountText;
	cocos2d::ui::TextField* m_pPasswordText;
	cocos2d::ui::TextField* m_pCurrentText;
};

#endif